<template>
    <div>
        <div class="index">
            <div class="w1">
                <span v-for="i in nalist" :key="i" :style="[{color: na == i?'#00c3ff':''},{borderBottom: na == i?'3px solid #00c3ff':''},]" @click="active(i)">{{i}}</span>
            </div>
            <div class="w2">
                <Postson :the_data1="data1List"></Postson>
            </div>
        </div>
    </div>
</template>

<script>
import Postson from '../UserpersonalCenter/Postson.vue'
export default {
    components: {Postson},
    data () {
        return {
            na: '帖子',
            nalist: ['帖子', '合集'],
            data1List: null,
            data1: [
                {
                    id: 1,
                    img1: 'https://img-static.mihoyo.com/avatar/avatar10014.png',
                    icon: '../../assets/img/v.png',
                    name: '西风快报员',
                    grade: 'https://img-static.mihoyo.com/level/level16.png',
                    time: '22小时',
                    title: '[百货奇货]活动：开奇货匣得原石!',
                    brief: '常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f',
                    listImg: [
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg'
                    ],
                    label: ['你好uacdfssf','不好吧','太好啦'],
                    views: '168万+',
                    comment: '9800',
                    give: '16万+'
                },{
                    id: 2,
                    img1: 'https://img-static.mihoyo.com/avatar/avatar10014.png',
                    icon: '../../assets/img/v.png',
                    name: '西风快报员',
                    grade: 'https://img-static.mihoyo.com/level/level16.png',
                    time: '22小时',
                    title: '[百货奇货]活动：开奇货匣得原石!',
                    brief: '常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f',
                    listImg: [
                        'https://upload-bbs.mihoyo.com/upload/2022/03/30/5f1612a985b3c421e3298bc17618a43b.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/3fe57965ed348966dd93dfaba28da0f6.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/b20891f66c723d6c569c1e8f3447671e.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg'
                    ],
                    label: ['你好uacdfssf','不好吧','太好啦'],
                    views: '168万+',
                    comment: '9800',
                    give: '16万+'
                }
            ],
            data2: null
        }
    },
    mounted() {
        this.load()
    },
    methods: {
        load() {
            this.data1List = this.data1
        },
        active(i) {
            this.na = i
            if(i == '帖子') {
                this.data1List = this.data1
            }else {
                this.data1List = this.data2
            }
        }
    }
}
</script>

<style lang="less" scoped>
    .index {
        .w1 {
            border-bottom: 1px solid #ccc;
            display: flex;
            span {
                padding: 16px;
                margin-left: 30px;
                font-size: 16px;
                cursor: pointer;
            }
        }
        .w2 {
            padding: 20px;
            margin-top: -10px;
        }
    }
</style>